import {Component, OnInit} from '@angular/core';
import {HttpClient} from "@angular/common/http";

@Component({
  selector: 'app-jsplumb',
  templateUrl: './jsplumb.component.html',
  styleUrls: ['./jsplumb.component.scss']
})
export class JsplumbComponent implements OnInit {
  diagramData: any;

  constructor(private httpClient: HttpClient) {
  }

  ngOnInit() {
    this.getData();
  }

  buildJsplumb() {

  }

  getData() {
    const url = 'assets/mock/jsplumb-data.json';
    this.httpClient.get(url).subscribe(json => {
      if (json) {
        this.diagramData = json;
      }
    })
  }
}
